<%@ page contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@ page import="com.wlcorp.forcazamis.domain.sample.Sample" %>
<%@ page import="com.wlcorp.forcazamis.domain.sample.SubSampleAssign" %>
<%@ page import="com.wlcorp.forcazamis.domain.sample.SubSample" %>
<%@ page import="com.wlcorp.forcazamis.domain.baseinfo.Depot" %>
<%@ page import="java.util.Set" %>
<%
	List subSampleList = (List)request.getAttribute("subSampleList");
	List depotList = (List)request.getAttribute("depotList");
%>
<html>
<head>
	<title>样品库存情况</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">
	<link href="${pageContext.request.contextPath}/css/css.css" rel=stylesheet>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/button_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/form_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/table_css.css" type="text/css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/pagetitle_css.css" type="text/css">
</head>
<body bgcolor="#ffffff">
  <center>
	<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
          <tr bgcolor="#E7E7E7">
            <td rowspan="2">序号</td>
            <td rowspan="2">部门</td>
            <td colspan="<%=subSampleList.size()%>" align="center">样品</td>
          </tr>
          <tr bgcolor="#E7E7E7">
          <% 
          	
          	for(Iterator iter = subSampleList.iterator();iter.hasNext();){
          		SubSample subSample = (SubSample)iter.next();
          		
          %>
            <td><%=subSample.getParentSample().getSampleCode()%>[<%=subSample.getCcolorDesc()%>]</td>
          <%}%>
		  </tr>
		  <% 
          	int index = 0;
          	for(Iterator iter = depotList.iterator();iter.hasNext();){
          		Depot depot = (Depot)iter.next();
          		index++;
          %>
          <tr bgcolor="#ffffff" onmouseover="this.style.backgroundColor='#bbdffb';" onmouseout="this.style.backgroundColor='#ffffff'">
            <td><%=index%></td>
            <td nowrap><%=depot.getDepotName()%></td>
            <%
            	Set subSampleAssignSet = depot.getSubSampleAssignSet();
            	
            	for(Iterator iterator = subSampleList.iterator();iterator.hasNext();){
          			SubSample subSample = (SubSample)iterator.next();
          			boolean flag = false;
          			for(Iterator assignIter = subSampleAssignSet.iterator();assignIter.hasNext();){
          				SubSampleAssign subSampleAssign = (SubSampleAssign)assignIter.next();
          				if(subSampleAssign.getSubSample().getSubSampleId().equals(subSample.getSubSampleId())){
          			
            %>
            <td><%=subSampleAssign.getSampleCount()%></td>
            <%
            	flag = true;
            	break;
            	}
            	}
            	if(!flag){
            	%>
            	<td>0</td>
            	<%}}%>
		  </tr>
		  <%}%>
	</table>
  </center>
</body>
</html>
<jsp:include page="../footer.jsp"/>